Option Explicit On
Option Strict On

Imports System.Collections
Imports nstl

Namespace nstl.test
    Public Class mod_less_int
        Implements IBinaryPredicate(Of Integer, Integer)
        Implements IComparer
        Private Function execute(ByVal lhs As Integer, ByVal rhs As Integer) As Boolean Implements IBinaryPredicate(Of Integer, Integer).Execute
            Return Compare(lhs, rhs) < 0
        End Function
        Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
            Dim lhs As Integer = DirectCast(x, Integer)
            Dim rhs As Integer = DirectCast(y, Integer)
            If Math.Abs(lhs) < Math.Abs(rhs) Then
                Return -1
            ElseIf Math.Abs(lhs) > Math.Abs(rhs) Then
                Return 1
            Else
                Return 0
            End If
        End Function
    End Class
End Namespace
